#include <stdio.h>

 int avage(int n,int k){
     int A=0;
     int B=0;
     int i=1;
     float counta=0,countb=0;
     
    for(i=1;i<=n;i++)
       {if(i%k==0)
            { A=A+i;
              counta++;
            }
        else
            { B=B+i;
              countb++;
            }
        }

        printf("%.1f %.1f",A/counta,B/countb);
        return 0;
   }

 int main(){
    int x,y;
    scanf("%d %d",&x,&y);
    avage(x,y);
 }